package dst.ass2.ejb.ws.impl;

import javax.xml.bind.annotation.adapters.XmlAdapter;

import dst.ass2.ejb.ws.IGetStatsRequest;

public class GetStatsRequestAdapter extends XmlAdapter<String, IGetStatsRequest> {

    @Override
    public String marshal(IGetStatsRequest request) throws Exception {
        return Integer.toString(request.getMaxProcessings());			
    }

    @Override
    public IGetStatsRequest unmarshal(String request) throws Exception {
        GetStatsRequest r = new GetStatsRequest();
        r.setMaxProcessings(Integer.parseInt(request));
        return r;
    }

}